package com.cjm.ry.jvm.p1;

import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.concurrent.TimeUnit;

public class WeakRf {
    public static void main(String[] args) {
        extracted();
        int i = 0;
        while (i < 10) {
            i++;
            System.gc();
            try {
                TimeUnit.MILLISECONDS.sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }

    private static void extracted() {
        LoaderTest loaderTest = new LoaderTest();
        System.err.println(loaderTest.getXx());
    }
}
